UEFI shell - 脚本文件 |
您所在的位置:网站首页 › efi shell 退出 › UEFI shell - 脚本文件 |
UEFI shell下的脚本文件的命名格式为: ****.nsh 脚本的语法和规范参考: 《EFI Shell User’s Guide》《UEFI原理与编程》 1. 写一个简单的脚本测试下:脚本名为test.nsh,内容如下: pciUEFI shell有一个开机自启动脚本,命名startup.nsh 开启虚拟机,不做任何操作,结果如下: 参考 edk2/ShellPkg/Application/Shell/Shell.c ... STATIC CONST CHAR16 mStartupScript[] = L"startup.nsh"; ... { ....... // // Try to find 'Startup.nsh' in the execution path defined by the environment variable PATH. // if ((StartupScriptPath == NULL) || EFI_ERROR (ShellIsFile (StartupScriptPath))) { SHELL_FREE_NON_NULL (StartupScriptPath); StartupScriptPath = ShellFindFilePath (mStartupScript); } ...... /** Find a file by searching the CWD and then the path. If FileName is NULL then ASSERT. If the return value is not NULL then the memory must be caller freed. @param FileName Filename string. @retval NULL the file was not found @return !NULL the full path to the file. **/ CHAR16 * EFIAPI ShellFindFilePath ( IN CONST CHAR16 *FileName ); }; |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |